home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aax.d64
/
mini golf
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
10KB
|
360 lines
10 REM ********************
11 REM *** ***
12 REM ** MINIATURE GOLF **
13 REM *** ***
14 REM ********************
15 :
16 :
20 GOSUB1000:REM INSTRUCTIONS
30 GOSUB2000:REM SETUP
40 GOSUB3000:REM PLAY!
50 GOSUB4000:REM !END!
60 END
70 :
1000 :
1001 :REM *** INSTS ***
1002 :
1003 POKE53281,1:POKE53280,1
1010 PRINT"[147][152]"
1020 PRINTTAB(9)"*** MINIATURE GOLF ***
1025 [153]:[153]
1030 [153]"WELCOME TO THE ALBERTS COUNTRY CLUB. THIS BEAUTIFUL NINE-HOLE ";
1031 [153]"MINIATURE GOLF COURSE IS OPEN AND WAITING FOR YOU !"
1035 [153]
1040 [153]"YOU SHOULD KNOW THE RULES OF THE COURSE BEFORE YOU BEGIN PLAY !"
1041 [153]
1045 [153]"TO PUTT THE BALL,YOU HAVE TO INPUT WHICH WAY YOU WANT TO ";
1046 [153]"AIM IT."
1047 [153]"THERE ARE 8 DIRECTIONS, SHOWN BELOW YOUR BALL IS ASSUMED TO BE AT *"
1050 [153]:[153][163]17)"2 1 8":[153][163]17)"3 * 7":[153][163]17)"4 5 6"
1060 [153]:[153]:[153]"PRESS RETURN WHEN READY TO CONTINUE"
1065 [161]X$:[139]X$[179][177][199](13)[167]1065
1070 [153]"LOAD"
1075 [153][163]9)"*** MINIATURE GOLF ***
1076 PRINT:PRINT
1080 PRINT"THEN YOU MUST INPUT HOW HARD TO HIT THE BALL. THE SPEED SHOULD ";
1081 PRINT"BE SOME NUMBER BETWEEN 0.00 AND 5.00. FOR EXAMPLE, YOUCOULD";
1082 PRINT" HIT THE BALL A RELATIVE SPEED OF 3.2"
1085 PRINT
1090 PRINT"IT WILL TAKE A FEW TRIES BEFORE YOU GET USED TO HOW HARD TO PUTT ";
1095 PRINT"THE BALL.":PRINT
1100 PRINT"ALSO, THERE ARE FOUR TYPES OF HAZARDS ONTHE COURSE. YOU SHOULD ";
1105 PRINT"BE AWARE OF WHATTHEY ARE AND WHAT AFFECT THEY HAVE ON YOU ";
1106 PRINT"AND YOUR BALL."
1110 PRINT:PRINT:PRINT:PRINT"PRESS RETURN WHEN READY TO CONTINUE"
1115 GETX$:IFX$<>CHR$(13)THEN1115
1120 PRINT"[147]"
1125 PRINTTAB(9)"*** MINIATURE GOLF ***
1126 [153]:[153]
1130 [153]"BLOCKS: THESE ARE LIKE WALLS. YOU MUST PUTT AROUND THEM."
1135 [153]
1140 [153]"YELLOW TRAPS REPRESENT SAND. YOUR BALL CANNOT PENETRATE THROUGH ";
1141 [153]"A SAND TRAP. THE PENALTY FOR LANDING IN THE SAND IS ONE STROKE."
1145 [153]
1150 [153]"WATER: LIKE SAND, THESE BLUE HAZARDS WILL STOP YOUR BALL.";
1151 [153]" THE PENALTY FOR LANDING IN WATER IS ONE STROKE."
1155 [153]
1160 [153]"UNEVEN SURFACES: THESE RED HAZARDS CAUSETHE BALL TO ROLL IN ";
1165 [153]"A DIRECTION WHICH ISUNPREDICTABLE THERE IS NO PENALTY ";
1166 [153]"FORHITTING THIS HAZARD."
1170 [153]:[153]:[153]"PRESS RETURN WHEN READY TO CONTINUE"
1175 [161]X$:[139]X$[179][177][199](13)[167]1175
1180 [153]"LOADPRINT#"
1185 [153][163]9)"*** MINIATURE GOLF ***
1186 PRINT:PRINT
1190 PRINT"YOU ARE TRYING TO SINK THE BALL IN AS FEW TRIES AS POSSIBLE. ";
1191 PRINT"THE HOLE IS THE BLACK SQUARE."
1195 PRINT
1200 PRINT"IF YOU HIT THE BALL TOO HARD, IT WILL JUMP OVER THE HOLE AND ";
1205 PRINT"CONTINUE ROLLING.IT MAY ALSO CHANGE DIRECTION, SO BE SURETO HIT ";
1206 PRINT"THE BALL JUST HARD ENOUGH."
1210 PRINT:PRINT:PRINT"PRESS RETURN WHEN READY TO CONTINUE"
1215 GETX$:IFX$<>CHR$(13)THEN1215
1990 RETURN
2000 :
2001 :REM *** SETUP ***
2002 :
2010 DIMHA(9,5):FORI=1TO9:FORJ=1TO5:READHA(I,J):NEXT:NEXT
2011 DATA 0,0,0,0,2
2012 DATA 1,0,0,0,3
2013 DATA 0,1,0,0,3
2014 DATA 1,1,0,0,3
2015 DATA 0,0,0,1,3
2016 DATA 0,0,1,1,3
2017 DATA 1,0,1,0,3
2018 DATA 0,1,1,0,4
2019 DATA 0,0,1,1,3
2020 DIMDI(8,2):FORI=1TO8:READDI(I,1),DI(I,2):NEXT
2025 DATA 0,-1, -1,-1, -1,0, -1,1, 0,1, 1,1, 1,0, 1,-1
2030 PLT=49152:FORI=0TO24:READC:POKEPLT+I,C:NEXTI
2031 DATA32,16,192,132
2032 DATA253,32,16,192
2033 DATA152,170,164,253
2034 DATA24,76,240,255
2035 DATA32,253,174,32
2036 DATA158,173,76,170,177
2040 DIMV(8):FORI=1TO8:READV(I):NEXT:DATA-40,-41,-1,39,40,41,1,-39
2050 :
2055 DEF FNCO(X)=PEEK(55296+BX+40*BY+X)AND15
2060 DEF FNSC(X)=PEEK(1024+BX+40*BY+X)
2090 RETURN
2100 REM *** HOLE 1 ***
2105 GOSUB2050
2106 PRINT""
2110 PRINTTAB(10)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2112 FORI=1TO15
2115 PRINTTAB(10)"[161] [146][144][161]"
2120 NEXT
2125 PRINTTAB(10)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2130 PRINT""TAB(19)" "
2135 BY=16:BX=11+INT(17*RND(0)):SYSPLT,BX,BY:PRINT"[209]";
2140 RETURN
2200 REM *** HOLE 2 ***
2205 GOSUB2050
2206 PRINT""
2210 PRINTTAB(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2212 FORI=1TO5
2215 PRINTTAB(8)"[161] [146][144][161]"
2220 NEXT
2221 PRINTTAB(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][146][190]"
2222 PRINTTAB(8)"[161] [146][144][161]"
2223 PRINTTAB(8)"[161] [146][144][161]"
2224 PRINTTAB(8)"[161] [146][144][161]"
2225 PRINTTAB(8)"[161] [146][144][161]"
2226 FORI=1TO6
2227 PRINTTAB(8)"[161] [146][144][161]"
2230 NEXT
2235 PRINTTAB(8)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2240 BY=17:BX=9+INT(15*RND(0)):SYSPLT,BX,BY:PRINT"[209]";
2245 PRINT""TAB(30)"[144] "
2250 RETURN
2300 REM *** HOLE 3 ***
2306 PRINT""
2310 PRINTTAB(20)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2312 FORI=1TO5
2315 PRINTTAB(20)"[161] [146][144][161]"
2320 NEXT
2321 PRINTTAB(8)"[146][172][162][162][162][162][162][162][162][162][162][162][162][190] [146][144][161]"
2322 PRINTTAB(8)"[161] [146][144][161]"
2323 PRINTTAB(8)"[161] [158] [146][144][161]"
2324 PRINTTAB(8)"[161] [158] [146][144][161]"
2325 PRINTTAB(8)"[161] [158] [146][144][161]"
2326 PRINTTAB(8)"[161] [158] [146][144][161]"
2335 PRINTTAB(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2340 FORI=1TO4
2345 PRINTTAB(8)"[161] [146][144][161]"
2350 NEXT
2355 PRINTTAB(8)"[146][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2360 PRINT""TAB(32)"[144] "
2365 BY=17:BX=9+INT(15*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2390 RETURN
2400 REM *** HOLE 4 ***
2406 PRINT""
2410 PRINTTAB(7)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2412 FORI=1TO6
2415 PRINTTAB(7)"[161] [146][144][161]"
2420 NEXT
2421 PRINTTAB(7)"[161] [144][172][162][162][162][162][162][162][162][162][162][187][146] [146][144][161]"
2425 FORI=1TO4
2430 PRINTTAB(7)"[161] [144][146][161] [161] [146][144][161]"
2435 NEXT
2440 PRINTTAB(7)"[161] [144][188][146][162][162][162][187] [188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2445 FORI=1TO3
2450 PRINTTAB(7)"[161] [144][146][161]"
2455 NEXT
2460 PRINTTAB(7)"[188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2465 PRINT""TAB(18)"[158] [157][157][157][157][157][157] [157][157][157][157] "
2470 PRINTTAB(25)" [157][157][157] [157][157][157][157][157] [157][157] "
2475 SYSPLT,32,10:PRINT"[144] "
2480 BY=16:BX=8+INT(10*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2490 RETURN
2500 REM *** HOLE 5 ***
2505 PRINT""
2506 PRINT""
2510 PRINTTAB(10)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2512 FORI=1TO15
2515 PRINTTAB(10)"[161] [146][144][161]"
2520 NEXT
2525 PRINTTAB(10)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2530 SYSPLT,19,6:PRINT"[173][195][195][195][195][195][189]"
2535 SYSPLT,22,4:PRINT"[144] "
2540 BY=16:BX=11+INT(23*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2590 RETURN
2600 REM *** HOLE 6 ***
2605 GOSUB2050
2606 PRINT""
2610 PRINTTAB(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2612 FORI=1TO7
2615 PRINTTAB(8)"[161] [146][144][161]"
2620 NEXT
2625 PRINTTAB(8)"[161] [144][172][162][162][162][162][162][162][162][162][162][146][190]"
2630 FORI=1TO7
2635 PRINTTAB(8)"[161] [146][144][161]"
2640 NEXT
2645 PRINTTAB(8)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2650 SYSPLT,27,4:PRINT"[176][157][194][157][173]"
2655 SYSPLT,20,5:PRINT" [157][157][157][157][157][157] [157][157][157][157][157] [157][157] "
2660 SYSPLT,30,5:PRINT"[144] "
2665 BY=16:BX=9+INT(15*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2690 RETURN
2700 REM *** HOLE 7 ***
2706 PRINT""
2710 PRINTTAB(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2712 FORI=1TO4
2715 PRINTTAB(8)"[161] [146][144][161]"
2720 NEXT
2721 PRINTTAB(8)"[161] [144][188][146][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2725 FORI=1TO4
2727 PRINTTAB(8)"[161] [144][146][161]"
2730 NEXT
2735 PRINTTAB(8)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187] [144][146][161]"
2740 FORI=1TO5
2745 PRINTTAB(24)"[144][161] [144][146][161]"
2750 NEXT
2755 PRINTTAB(24)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2760 SYSPLT,9,7:PRINT" [157][157][157][157] [157][157][157][157] [157][157][157][157][157] "
2765 SYSPLT,27,7:PRINT" [157][157][157][157][157][157] [157][157][157][157][157][157] [157][157][157][157][157][157][157] "
2770 SYSPLT,13,4:PRINT"[144] "
2775 BY=16:BX=25+INT(13*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2799 RETURN
2800 REM *** HOLE 8 ***
2806 PRINT""
2810 PRINTTAB(7)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2812 FORI=1TO6
2815 PRINTTAB(7)"[161] [146][144][161]"
2820 NEXT
2821 PRINTTAB(7)"[161] [144][172][162][162][162][162][162][162][162][187] [146][144][161]"
2825 FORI=1TO4
2830 PRINTTAB(7)"[161] [144][146][161] [161] [146][144][161]"
2835 NEXT
2840 PRINTTAB(7)"[188][162][162][162][162][162][162][162][162][162][162][146][190] [161] [144][146][161]"
2845 FORI=1TO3
2850 PRINTTAB(26)"[161] [144][146][161]"
2855 NEXT
2860 PRINTTAB(26)"[188][162][162][162][162][162][162][162][162][162][162][146][190]"
2865 SYSPLT,28,2:PRINT" "
2866 SYSPLT,29,3:PRINT" "
2867 SYSPLT,30,4:PRINT" "
2868 SYSPLT,30,5:PRINT" "
2869 SYSPLT,32,6:PRINT" "
2870 SYSPLT,33,7:PRINT" "
2875 SYSPLT,13,3:PRINT"[158] [157][157][157][157] [157][157][157][157][157] [157][157][157][157] "
2880 SYSPLT,13,10:PRINT"[144] "
2885 BY=16:BX=27+INT(10*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2890 RETURN
2900 REM *** HOLE 9 ***
2905 GOSUB2050
2906 PRINT""
2910 PRINTTAB(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
2912 FORI=1TO9
2915 PRINTTAB(8)"[161] [146][144][161]"
2920 NEXT
2921 PRINTTAB(8)"[188][162][162][162][162][162][162][162][162][162][162][162][187] [146][144][161]"
2925 FORI=1TO5
2927 PRINTTAB(20)"[161] [146][144][161]"
2930 NEXT
2935 PRINTTAB(20)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
2940 SYSPLT,21,2:PRINT" "
2941 SYSPLT,22,3:PRINT" "
2942 SYSPLT,23,4:PRINT" "
2943 SYSPLT,24,5:PRINT" "
2944 SYSPLT,25,6:PRINT" "
2950 SYSPLT,11,6:PRINT"[144] "
2955 SYSPLT,14,5:PRINT"[174][157][194][157][189]"
2960 BY=16:BX=21+INT(15*RND(0)):SYSPLT,BX,BY:PRINT"[209]"
2990 RETURN
3000 :
3001 :REM *** PLAY ***
3002 :
3010 FORHO=1TO9:BC$=""
3015 PRINT"[147]";
3020 ONHOGOSUB2100,2200,2300,2400,2500,2600,2700,2800,2900
3030 PRINT"[154]HOLE NUMBER:"HO"PAR:"HA(HO,5)"SCORE:"SC
3031 PRINT:PRINT"TRAPS:":IFHA(HO,1)THENPRINT"WATER"
3032 IFHA(HO,2)THENPRINT"[158]SAND"
3033 IFHA(HO,3)THENPRINT"UNEVEN"
3034 IFHA(HO,4)THENPRINT"[144]BLOCKS"
3035 PRINT:PRINT"[144]2 1 8":PRINT"3 [209] 7":PRINT"4 5 6"
3036 SYSPLT,0,19:FORI=1TO5:PRINT" ":NEXT
3038 D$="":SYSPLT,0,20:INPUT"DIRECTION (1-8)";D$:DIR=VAL(D$)
3040 IFDIR>0ANDDIR<9ANDDIR=INT(DIR)THEN3045
3041 PRINT"THE DIRECTION IS FROM 1 TO 8 ...":FORPA=1TO1500:NEXT:GOTO3036
3045 SYSPLT,0,19:FORI=1TO5:PRINT" ":NEXT
3046 D$="":SYSPLT,0,20:INPUT"SPEED (0-5)";D$:SP=VAL(D$)
3050 IFSP=>0ANDSP<=5THEN3055
3051 PRINT"THE SPEED IS FROM 0 TO 5...":FORPA=1TO1500:NEXT:GOTO3045
3055 UF=0:REM CLEAR UNEVEN FLAG
3056 TF=0:REM CLEAR TRAP FLAG
3100 X2=BX+DI(DI,1):Y2=BY+DI(DI,2)
3110 D2=V(DI):CO=FNCO(D2):IFCO<>5ORFNSC(D2)<>160THEN3120
3115 SYSPLT,BX,BY:PRINTBC$" ";:BX=X2:BY=Y2:SYSPLT,BX,BY:PRINT"[209]";
3116 BC$="":GOTO3900
3120 IFCO=0ANDFNSC(D2)<>160THEN3200:REM HIT A WALL
3121 IFCO=6THEN3300:REM WATER
3122 IFCO=7THEN3400:REM SAND
3123 IFCO=2THEN3500:REM UNEVEN
3124 IFCO=0THEN3600:REM THE HOLE
3200 IFDI=1ORDI=3THENDI=DI+4:GOTO3100
3201 IFDI=7ORDI=5THENDI=DI-4:GOTO3100
3210 ONDI/2GOTO3220,3240,3260,3280
3220 IFFNSC(D2+1)<>160ANDFNSC(D2+40)<>160THENDI=6:GOTO3100
3225 IFFNSC(D2+1)<>160THENDI=4:GOTO3100
3230 IFFNSC(D2+40)<>160THENDI=8:GOTO3100
3235 DI=6:GOTO3100
3240 IFFNSC(D2+1)<>160ANDFNSC(D2-40)<>160THENDI=8:GOTO3100
3245 IFFNSC(D2+1)<>160THENDI=2:GOTO3100
3250 IFFNSC(D2-40)<>160THENDI=6:GOTO3100
3255 DI=8:GOTO3100
3260 IFFNSC(D2-1)<>160ANDFNSC(D2-40)<>160THENDI=2:GOTO3100
3265 IFFNSC(D2-1)<>160THENDI=8:GOTO3100
3270 IFFNSC(D2-40)<>160THENDI=4:GOTO3100
3275 DI=2:GOTO3100
3280 IFFNSC(D2-1)<>160ANDFNSC(D2+40)<>160THENDI=4:GOTO3100
3285 IFFNSC(D2-1)<>160THENDI=6:GOTO3100
3290 IFFNSC(D2+40)<>160THENDI=2:GOTO3100
3295 DI=4:GOTO3100
3300 IFTFTHEN3310
3305 TF=3:SC=SC+1:REM TRAP FLAG
3310 SYSPLT,BX,BY:PRINTBC$" ";
3315 BX=X2:BY=Y2:SYSPLT,BX,BY:PRINT"[209]";:BC$=""
3320 GOTO3900
3400 IFTFTHEN3410
3405 TF=3:SC=SC+1:REM TRAP FLAG
3410 SYSPLT,BX,BY:PRINTBC$" ";
3415 BX=X2:BY=Y2:SYSPLT,BX,BY:PRINT"[158][209]";:BC$="[158]"
3420 GOTO3900
3500 IFUFTHEN3520
3505 UF=1:REM UNEVEN FLAG, HAVE RE ROLLED BALL OFF COURSE YET?...
3510 DI=DI+2*INT(2*RND(0))-1
3515 IFDI=0THENI=8
3516 IFDI=9THENI=1
3520 SYSPLT,BX,BY:PRINTBC$" ";
3525 BX=X2:BY=Y2:SYSPLT,BX,BY:PRINT"[209]";:BC$=""
3530 GOTO3900
3600 SYSPLT,BX,BY:PRINT" ":SYSPLT,X2,Y2:PRINT" "
3601 SYSPLT,X2,Y2:PRINT"[144] ";
3602 DI=DI+2*INT(2*RND(0))-1
3604 IFDI=0THENDI=8
3605 IFDI=9THENDI=1
3606 SP=SP-.5:IFSP>0THENX2=X2+DI(DI,1):Y2=Y2+DI(DI,2):GOTO3110
3610 SC=SC+1:GOTO3990
3900 :
3902 IFTF>0THENTF=TF-1:IFTF=0THEN3910
3905 SP=SP-.3:IFSP>0THEN3100
3910 SC=SC+1:GOTO3030
3980 GETX$:IFX$=""THEN3980
3990 NEXTHO:RETURN
4000 :
4001 :REM *** END ***
4002 :
4005 FORPA=1TO200:NEXTPA
4010 PRINT"[147]";TAB(9)"*** MINIATURE GOLF ***"
4015 PRINT:PRINT:PRINT:PRINT
4020 PRINT"THE GAME IS OVER !"
4022 PRINT
4025 PRINT"ON THE PAR 27 COURSE, YOU SHOT":PRINT"A ROUND OF"SC". THAT IS AN"
4026 PRINT"AVERAGE OF"INT(SC*100/9)/100"SHOTS PER HOLE."
4030 PRINT:PRINT:PRINT
4035 PRINT"HOPE YOU ENJOYED THE GAME!"
4990 RETURN